from typing import TypeVar, Generic, Optional, List, Dict, Any
from mysql.connector import pooling

T = TypeVar('T')

class BaseRepository(Generic[T]):

    def __init__(self, table_name: str, model_class: type, pool: pooling.MySQLConnectionPool):
        self.table_name = table_name
        self.model_class = model_class
        self.pool = pool

    def _get_connection(self):
        return self.pool.get_connection()

    def create(self, record: T) -> int:
        pass

    def get_by_id(self, id: int) -> Optional[T]:
        pass

    def update(self, record: T) -> bool:
        pass

    def delete(self, record: T) -> bool:
        pass

    def query(self, conditions: Dict[str, Any]) -> List[T]:
        pass